package sonet;

/** Class Publication. */
public abstract class Publication extends PublicationComponent implements Attachment{
	private int _id;
	private String _legend;
	private String _content;
	Permission _access;
	
/** Publication's Constructor. */	
	public Publication(int id,int owner, String legend, String content){
		_access = new Permission();
		_id = id;
		_legend = legend;
		_content = content;		
	}
	
/** Checks if has Permission/access to the Publication. */	
	boolean hasAccess(Agent a){
		return _access.hasAccess(a);
	}
	
/** Protects a Publication from a certain agent. */	
	void protect(Agent a){
		_access.protect(a);
	}
	void unProtect(Agent a){
		_access.unProtect(a);
	}
	public int getIdentifier(){ return _id;}

}